<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>会员管理</h2>
    </div>
<div class="search-form fr cf">
            <div class="btn-group-click adv-sch-pannel fl">
                <div class="dropdown cf">
                    <div class="row">
                        <label>创建时间：</label>
                        <input type="text" id="time-start" name="time-start" class="text input-2x" value="" placeholder="起始时间" /> -
                        <div class="input-append date" id="datetimepicker"  style="display:inline-block">
                            <input type="text" id="time-end" name="time-end" class="text input-2x" value="" placeholder="结束时间" />
                            <span class="add-on"><i class="icon-th"></i></span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    <div class="data-table table-striped">
        <form class="ids">
            <table>
                <thead>
                    <tr>
                        <th>昵称</th>
                        <th>手机号</th>
                        <th>性别</th>
                        <th>年龄</th>
                        <th>开始时间</th>
                        <th>到期时间</th>
                    </tr>
                </thead>
                <tbody>
				<notempty name="data">
                <volist name="data" id="v">
                    <tr>
                        <td>{$v.nickname}</td>
                        <td>{$v.mobile}</td>
                        <td>{$v.sex}</td>
                        <td>{$v.age}</td>
                        <td>{$v.vip_time|date="Y-m-d H:i:s",###}</td>
                        <td>{$v.vip_endtime|date="Y-m-d H:i:s",###}</td>
                    </tr>
                </volist>
				<else/>
				<td colspan="10" class="text-center"> aOh! 暂时还没有内容! </td>
				</notempty>
                </tbody>
            </table>
        </form>
        <!-- 分页 -->
        <div class="page">
            {$_page}
        </div>
    </div>
</block>

<block name="script">
    <script type="text/javascript">
        $(function() {
            $('.oper').click(function(){
                var mes = $(this).html();
                if (confirm('确定要'+mes+'吗？')) {
                    var id = $(this).attr('data');
                    var val = $(this).attr('val');
                    var flag = $(this).attr('flag');
                    $.post('__CONTROLLER__/edit', {'id': id,'val':val, 'flag':flag}, function(msg) {
                        alert(msg);
                        location.reload();
                    });
                }
            });

$("#search").click(function(){
        var str = $("#campus").val();
        var num = $('.drop-down span').html();
        var replaces = $('.drop-down span').html();
                switch(num)
                {
                case '昵称':
                    num = 'nickname';
                  break;
                case '手机号':
                    num = 'mobile';
                  break;
                }
        window.location.href="__CONTROLLER__/showUser/str/"+str+"/num/"+num+"/replaces/"+replaces;
    });

    /* 状态搜索子菜单 */
    $(".search-form").find(".drop-down").hover(function(){
        $("#sub-sch-menu").removeClass("hidden");
    },function(){
        $("#sub-sch-menu").addClass("hidden");
    });
    $("#sub-sch-menu li").find("a").each(function(){
        $(this).click(function(){
            var text = $(this).text();
            $("#sch-sort-txt").text(text).attr("data",$(this).attr("value"));
            $("#sub-sch-menu").addClass("hidden");
        })
    });

    //回车自动提交
    $('.search-form').find('input').keyup(function(event){
        if(event.keyCode===13){
            $("#search").click();
        }
    });

  });
    </script>
</block>